const objData = [1, null, undefined, 2, "", 3, 6];

const newData = objData.filter(Boolean)

console.log(newData) // [1, 2, 3, 6]
console.log('newData',newData) // [1, 2, 3, 6]
console.log('objData',objData) // [1, null, undefined, 2, "", 3, 6]
